package com.hlcl.huaji.view;

import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.widget.LinearLayout;

import com.elcl.activity.PageTopView;
import com.elcl.activity.fragment.BaseFragmentActivity;
import com.elcl.util.viewutils.WindowUtils;
import com.hlcl.huaji.R;

/**
 * Created by lichunlin on 2018/5/23.
 * 订单列表的activity
 */

public class OrderListActivity extends FragmentActivity {

    private int orderType = 0;
    @Override
    protected void onCreate(Bundle arg0) {
        super.onCreate(arg0);
        setContentView(R.layout.ac_order_list);

        WindowUtils windowUtils = new WindowUtils();
        windowUtils.fullScreen(OrderListActivity.this);

        orderType = getIntent().getIntExtra("orderType",0);
        String title = getOrderByType();

        PageTopView pt = findViewById(R.id.pt);
        pt.initTop(title);

        OrderFragment orderFragment = OrderFragment.getInstance(orderType,HomeFragment.homeFragment);
        getSupportFragmentManager().beginTransaction().replace(R.id.ll_all,orderFragment).commitAllowingStateLoss();

    }

    private String getOrderByType(){
        String title = "";
        if (orderType == 1){//全部
            title = "全部订单";
        }else if(orderType == 2){//待处理
            title = "待处理";
        }else if(orderType == 3){//处理中
            title = "处理中";
        }else if(orderType == 4){//已完成
            title = "已完成";
        }else if(orderType == 5){//已评价
            title = "已评价";
        }
        return title;
    }

    protected void praseJson(int reqId, String json) {

    }
}
